You can write the text to a NotesStream without actually opening the stream on an external file. To transform the XML, you can use any of the usual techniques -- a NotesDOMParser, a NotesSAXParser, a NotesXSLTransformer, or brute force (for example, Instr and Mid$). You can use LotusScript or Java. To create Notes documents, use a NotesDXLImporter. You might find the samples
here and
here are some help.